home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005 / CHIP Utilities 2005.iso / dosapps / pci / pci.doc < prev    next >
Encoding:
Text File  |  2004-07-08  |  45.9 KB  |  942 lines

  1.      PCI - The PCI System information & Exploration tool.
  2.  
  3.  
  4. The following is a somewhat rambling text, from which you should be able to
  5. extract everything you ever wanted to know about this program! Please excuse my
  6. poor documentation style; I really hate writing the docs :-) So read
  7. everything, the answer's probably there, somewhere.
  8.  
  9.  
  10.  
  11.  ■ General
  12.  
  13. This code is Written by Craig Hart in 1996-2004 and is under constant
  14. development. It is released as freeware; please use and modify at will. No
  15. guarantees are made or implied. Commercial use is also specifically permitted,
  16. without restriction. It's free, use it!
  17.  
  18. I'd appreciate credit if you find this code useful. I'd also be interested to
  19. see any code you may develop or modifications you create to this code...
  20. suggestions & bug fixes are _always_ welcomed.
  21.  
  22. I can be reached by email: chart@datafast.net.au
  23.  
  24. See my home page for the latest version of all my software releases,
  25. programmers information, updates for PCIDEVS.TXT and much more:
  26.  
  27. http://members.datafast.net.au/dft0802
  28.  
  29. ******** NOTE: NEW WEBSITE & EMAIL !!! ****************************************
  30.  
  31.  
  32. NOTE: Wherever you see the term PCI in this document, you can substitute AGP
  33. and/or CardBus, if appropriate, instead. PCI is the "root technology" upon
  34. which AGP and Cardbus are built, and share a common saet of basic design
  35. standards. AGP is pretty much just a new physical and electrical form of the
  36. PCI bus; CardBus is the 32-bit "version" of PCMCIA; software-wise, they're
  37. virtually identical. This also covers all the 'other' PCI variants, such as
  38. SmallPCI, PCI-X, PCI Express, etc.
  39.  
  40.  
  41.  
  42.   ■ Why create this program, anyhow? What use is it? What does it do?
  43.  
  44. PCI basically produces a report of the PCI, AGP & CardBus devices fitted to a
  45. PC, including the system chipset. A plethoria of information is reported on,
  46. including system resource useage (IRQs, Memory ranges, etc), capabilities
  47. (busmastering, caching), setup data (device latencies, general capabilities,
  48. features, subsystem info), and much, much more. A text-file PCIDEVS.TXT lists
  49. thousands of known vendors, devices and subsystems, which PCI will refer to and
  50. display the info from. PCI covers all PCI device derivitives, including PCI
  51. 64-bit & 66MHz options, AGP (all speeds to 8x), CompactPCI, CardBus and PCI-X.
  52.  
  53. PCIDEVS.TXT is a plain text file, so you can update it yourself, however it is
  54. updated regularly (virtually daily) by the author, and the latest revision is
  55. always available as a free download from the webpage (see general section).
  56.  
  57. This program was originally written purely for me to learn how to program the
  58. PCI BIOS found in newer PC's. Since then, this program has proven to be vastly
  59. more useful, especially in the hands of a technician, system builder, and also
  60. in the hands of those about to purchase or upgrade a PC.
  61.  
  62. To a technician or system builder, PCI can act as a system information and
  63. diagnostic tool. It lists the resources devices have been assigned (for
  64. example, IRQ's, Memory regions, etc) so it is handy for finding conflicts.
  65. Because PCI also identifies the devices fitted, it is handy in figuring out
  66. _exactly_ what drivers are required when setting up a system.
  67.  
  68. PC buyers don't need to open a PC to see exactly what they're getting: your
  69. vendor can't tell you fibs about the chipset, graphic-card, or whatever, and
  70. since the PC doesn't need to be opened to check what you ordered is what you
  71. got fitted, you aren't loosing any warranties.
  72.  
  73. Second hand parts hoarders can figure out what they have, just by plugging it
  74. in and running PCI - no more scratching your head over a mystery card you just
  75. stumbled across amongst your latest piles of aquired junk. As above, finding
  76. drivers becomes much easier when you can say *exactly* what brand model, and
  77. revision of card you have.
  78.  
  79. To a programmer, PCI is a learning tool, since it's full source code is
  80. supplied, and the dump configuration-space feature will help a programmer
  81. discover how a driver alters the hardware to activate special features or
  82. generally work with a given device.
  83.  
  84.  
  85.  
  86.   ■ Using PCI
  87.  
  88. Just run it. Read the output. Be happy!
  89.  
  90. You must place PCI.EXE and PCIDEVS.TXT together in the same directory. You must
  91. be "in" that directory before running PCI; in other words, do NOT run PCI from
  92. a path. This is because PCI only looks in the CURRENT directory for it's data
  93. file.
  94.  
  95. PCI (as of version 0.41ß) will pause at the end of each screenfull to allow you
  96. to read the report; press any key for the next page. Pausing is disabled if you
  97. are using I/O redirection.
  98.  
  99. PCI's output can be redirected (using MS-DOS pipes), for example to a text file
  100. on disk or a printer. IE "C:\>PCI > LOG.TXT" will generate a file on disk
  101. called LOG.TXT  This is handy if you want to keep a perminant record of the
  102. system under test, print it out, email it, or whatever.
  103.  
  104. PCI will be slow to generate it's report if run from a plain DOS computer from
  105. a floppy disk drive (due to reading the rather large pcidevs.txt file). For
  106. best speed run from within windows and/or from a hard disk drive. This is
  107. because the data file is more than 250k in size and is therefore not cached in
  108. memory. To improve speed under DOS a little, put buffers=20 in your config.sys
  109. file and reboot.
  110.  
  111. PCI does not function under Windows 2000 or NT or XP. 3.x/95/98/ME work OK, as
  112. does OS/2 Warp.  See the bugs and OS/2 sections for more info.
  113.  
  114.  
  115.  
  116. Syntax: PCI [/H] [/D] [/S] [/T] [/B] [/P] [/I] [/?]           ([] = optional)
  117.  
  118.  
  119. Commandline parameters:
  120.  
  121.   /H   Use direct-hardware access to retrieve the information. Normally, the
  122. system BIOS is called on to retrieve the information, however there are some
  123. BIOS's circa 1995 (Award v4.51 on Intel 430FX Chipset, early PCI Compaq's using
  124. the Triflex Bridge chip) that incorrectly report some information. By bypassing
  125. the BIOS, we can get the correct information. This only works if the BIOS uses
  126. configuration mechanism 1. Mechanism 2 systems can use the BIOS method only.
  127. Mechanism 2 systems are virtually non-existant as version 2.1 of the PCI
  128. specifications insists on the use of mechanism 1 only... the number of
  129. mechanism 2 chipsets is very small, and are now more than 7 years old.
  130.  
  131.   /D   Dump the PCI configuration space for each device. This option generates
  132. a 256 byte hex-dump of the PCI configuration space for each detected device.
  133. This is handy for people trying to learn to program a device, for those looking
  134. to discover any 'extra' undocumented registers in a device, observe the changes
  135. made by setup or driver software, and also to fault-find this program :-)
  136.  
  137.   /S   Produce summary report only. Lists vendors, devices, subsystem ID's
  138. and IRQ's only. Usefull for when you need a "quick glance" and don't want to
  139. wade through mountains of technical info. Still displays subsystem and IRQ
  140. info, as these are typically the most-used features of PCI.
  141.  
  142.  /T    Disble the BIOS IRQ Routing table tests. May be usefull if PCI crashes
  143. during this test, or you don't want to clutter up a device report with this
  144. 'extra' info.
  145.  
  146.  /B    List Bus, Device and Function info for each device. The bus number
  147. tells you which PCI bus the device resides on (look at the PCI bridges to see
  148. which bus number is 'created' by which bridge). The Device number is the PCI
  149. device identifier for that device on that bus (there can be 32 devices on each
  150. bus, and device numbers are generally non-contiguous). The function number is
  151. the internal sub-funtion of that PCI CHIP (many devices are single-function and
  152. only have a valid function 0, whilst others are multi-function and contain
  153. several sub-functions; each device may have as many as 8 sub-functions).
  154.  
  155.  /P    Read and display PCI IRQ-router information. The IRQ router is the
  156. device that connects the PCI slots INTA-INTD lines to the sytem's 16 IRQ lines.
  157.  
  158. The first part of this option shows what IRQ's are *potentially* available for
  159. the BIOS to connect each PCI slot. If you see Slot 00, it's an integrated
  160. (built on the motherboard) device, not a physical slot. You can work out which
  161. slot is which by using the /B command line parameter to display the Device &
  162. Bus info for each card, and then match this info up by looking physically at
  163. which card is in which slot.  Typically slots of the same bus are physically
  164. laid out in numeric order, either left to right, or right to left; different
  165. busses may be ordered differently to each other. Typically, all slots of a
  166. given bus are physically next to each other rather than bieng randomly
  167. distributed.
  168.  
  169. The second part of this option displays a table of slots and INTA-D link
  170. values. To interpret this table, first note that a non-zero link value under
  171. INTx means that that INTx pin on that PCI socket is wired to the IRQ router's
  172. <number xx> input. A 00 means that INT line is not connected *at all*.
  173.  
  174. Let's look at a typical table:
  175.  
  176.    SLOT BUS DEV   INTA INTB INTC INTD
  177.     01   0  17     01   02   03   05
  178.     02   0  18     02   03   05   01
  179.     03   0  19     03   05   01   02
  180.     04   0  20     05   01   02   03
  181.     00   0   1     01   02   03   05
  182.  
  183. What this table tells us is that Slot 01 and Slot 00 share the SAME link
  184. values, whilst the other 3 sockets each have different link values (under each
  185. INT line). How is this important? Each *link value* is mapped to a system IRQ,
  186. (but only if the PCI card signals that it requires an IRQ).
  187.  
  188. If Slot 00 and slot 01 are both populated (with cards that request an IRQ on
  189. the same INT line), they will both be assigned the SAME IRQ! similarly, if a
  190. card using INTD in Slot 2 and a card using INTB in slot 4 both require IRQ's,
  191. they will each be configured to the same IRQ. Depending on your OS, this may or
  192. may not be a good thing - some OS's don't support shared IRQs in this fashion
  193. (A.K.A.  the dreaded IRQ conflict) You may also want to know if you're going to
  194. get an IRQ conflict if you're about to fit a new card and don't want to use
  195. "trial and error" to get a non-shared IRQ assignment.
  196.  
  197. This table also highlights the other interesting points - if two slots have
  198. different link values under the same INT line, they CANNOT be configured to the
  199. SAME IRQ! Each slot will always be assigned a different IRQ from each other.
  200. Also, once a link-value has been assigned an IRQ, all other slots where that
  201. link value appears automatically take on that IRQ, so in many (but not all)
  202. cases you can predict what IRQ you will get when you fit a card to that slot.
  203. This sort of prediction an help in, for example, bulk-loading pre-configured
  204. software images into mass-produced systems.
  205.  
  206. If you have IRQ assignment problems, these tables may highlight why - perhaps a
  207. certain slot is incapable of having a desired IRQ assigned, or perhaps a given
  208. slot has a certain INTx line not connected. Careful examination of these tables
  209. will tell you straight away if this is the case or not.
  210.  
  211. The only thing this table won't tell you is which IRQ the BIOS will actually
  212. assign each slot - there is no way to determine this and most BIOS's seem to
  213. have no logical sequence for assigning resources; you get what you get! At
  214. least PCI will tell you what the BIOS has done, and it's up to you to decide if
  215. it's what you want, or not.
  216.  
  217. For more info, see also "PCI System Architecture" by Mindshare, inc. Chapter 11
  218. has several diagrams (figures 11-4 and 11-5 in the third edition, pp216-217) of
  219. IRQ router implementations that make this a lot easier to understand!
  220.  
  221. Finally, don't worry about the actual numerical link value (except for 00, of
  222. course) - that only has meaning to the BIOS; all we're looking for is the
  223. patterns the numbers represent, the numbers themselves are meaningless;
  224. letters, cute pictures, roman numerals, colours, whatever! would serve the same
  225. purpose just as well.
  226.  
  227.  /I   Installer mode. Special mode for use with external programs to do
  228. unattended driver installations and the like. Documented sperately below. Read
  229. on.
  230.  
  231.  
  232.  
  233.  ■ A note on PCMCIA and CardBus Support
  234.  
  235. PCI does NOT implement PCMCIA device detection!!  PCI can only detect CardBus
  236. cards that are inserted into CardBus controllers.  PCI can NOT detect PCMCIA
  237. cards, legacy-type PCMCIA controllers, or CardBus cards that are plugged into
  238. PCMCIA controllers. PCMCIA is a 16-bit standard, based on the ISA bus
  239. standards, and has nothing to do with PCI. CardBus is a 32-bit "version" or
  240. "upgrade" if you like, of PCMCIA; it uses the same physical connector and has
  241. backwards compatability for PCMCIA cards, but it appears to system software as
  242. just another PCI bus.
  243.  
  244. It seems that some sort of CardBus driver *may* also need to be loaded for
  245. CardBus detection to work. CardBus Detection seems to work reliably under
  246. Win9x/ME ONLY if the PC Card (PCMCIA) icon is visible in the taskbar, and
  247. reports the PC card as recognised and present in the socket. This may be
  248. somewhat counter-productive for those using installer mode! In the end, it
  249. comes down to what sort of CardBus support the BIOS has; if the BIOS supports
  250. booting from a CardBus card, for example, your chances are pretty good...but
  251. most BIOS's don't have CardBus support.
  252.  
  253.  
  254.  
  255.   ■ PCI Crashes the Computer!
  256.  
  257. It has come to my attention that there are VERY SMALL number of PCI devices out
  258. there on the market which are intolerant to having their configuration space
  259. registers read by software other than their own driver. This means that
  260. programs like PCI upset these devices when they read the device's configuration
  261. space, and the net result is a lock-up, crash, GPF or "blue screen of death"
  262. when PCI scans that device.
  263.  
  264. In order to "work around" this buggy hardware, PCI during installer mode and
  265. summary mode only reads the "standard" 64 configuration space registers, not
  266. the whole 256 registers. The first 64 registers give us the basic data which
  267. installer and summary modes need, and should not upset the device.
  268.  
  269. So, in summary, try PCI -S or PCI -I and see if the crash doesn't happen. If
  270. PCI works OK in that mode, then that is all you can use on that hardware. There
  271. is no way to run PCI in it's "full" reporting modes on this sort of buggy
  272. hardware - the full modes need to read the whole config space to get all the
  273. data to create the report!
  274.  
  275. This is yet another example of vendors doing a poor job with their hardware
  276. design processes, as this sort of bug just should not exist.
  277.  
  278.  
  279.  
  280.   ■ What does "Known Bad Subsystem ID" mean?
  281.  
  282. Sometimes when running PCI, you'll see the following message: "Subsystem Vendor
  283. XXXXh Known Bad Subsystem ID - no Vendor ID Available". This means that the
  284. device has reported a subsystem ID which is not compliant with the PCI
  285. standard, which PCI has taken special note of.
  286.  
  287. This is not an error or problem, and you don't have to report anything to me.
  288. This is just PCI's way of letting you know that it has detected a non-complaint
  289. subsystem ID (Which is listed in PCIDEVS.TXT as a type X entry - see the
  290. section on PCIDEVS.TXT file format for further information).
  291.  
  292. Normally, the subsystem ID consists of the subsystem vendor ID (SVID) and the
  293. subsystem device ID (SDID). The SVID lets you know what brand the device is,
  294. and the SDID the exact device model. When the subsystem "system" was first
  295. introduced, some vendors misinterpreted the standard, and failed to insert
  296. their SVID properly. Vendors soon corrected their errors, but there are at
  297. least 38 known "erronous" devices out there on the market, possibly the best
  298. known of them is the VIA 82cx86 southbridge-series USB Controller.
  299.  
  300. With a non-standard SVID, you can't tell what vendor made the device, so
  301. instead of reporting "unknown vendor" or identifying the incorrect vendor, we
  302. simply point out the fact that the vendor can't be determined.
  303.  
  304.  
  305.  
  306.   ■ What's the ROM IRQ routing table and IRQ-router info?
  307.  
  308. The PCI ROM IRQ routing table is a scheme devised by Microsoft to assist
  309. Windows Device Manager to reprogram PCI IRQs. It falls under the category of
  310. 'plug and play' support and is pretty much a vital component of any motherboard
  311. these days.
  312.  
  313. Normally, PCI IRQ's are set by the BIOS at boot time, and cannot be changed
  314. after the system is booted.
  315.  
  316. Microsoft didn't like that and so they devised a mechanism to allows Windows to
  317. change the IRQ assignments after boot-time. This makes sense, since Windows is
  318. much more capable of handling scenarios like hot-docking (and the shuffling of
  319. resources that this creates), that the BIOS clearly can't cope with in real
  320. time or hope to forsee at boot time.
  321.  
  322. The IRQ-router info is a PCI BIOS call that predates the ROM IRQ routing table,
  323. but offers similar information. The two should always agree! The disadvantage
  324. of the BIOS call is primarily that it is slow, but also that it is based on the
  325. very earliest versions of the PCI specifications, and thus lacks the
  326. expandability and flexability of the newer ROM routing table for future
  327. growth.
  328.  
  329. The PCI standards say that the hardware vendors are free to connect PCI INT
  330. lines to system IRQ's in any fashion they like; there is no "standard". In
  331. practice, there are at least 6 different ways chipsets have actually
  332. implemented INT-to-IRQ connections. Since this is the case, Windows needs to
  333. know a few things such as which INT's can be routed to which IRQs, which
  334. INT-to-IRQ mappings are fixed, and which INTs belong exclusively to PCI. With
  335. that data in hand, Windows can re-configure IRQs for PCI devices when/if
  336. required to resolve resource conflicts (in conjunction with all the other
  337. system-wide resource data that Device Manager holds), because the user has
  338. requested a specific resource setting, because of a hot-dock event, CardBus PC
  339. Card event, or whatever.
  340.  
  341. Only win95B (OSR2) or later supports this standard - Win95 original and OSR1
  342. don't.... under 95 & 95A, PCI IRQ resources are fixed (Windows uses whatever
  343. the BIOS assigned at boot time, and can't alter them) which is yet another
  344. reason not to use 95A, if you still do! 95A is particularly lousy at managing
  345. any sort of dockable/CardBus equipped laptop. 95B also has a few quirks, and is
  346. increasingly showing limitations on the most modern chipsets; therefore it is
  347. strongly recommended that Win98SE, Win2000 or newer OS's are used on modern
  348. (P4, Athlon XP, etc) hardware.
  349.  
  350. The knowledge that the routing table(s) are present and valid is therefore
  351. essential for determining why Windows is or is not correctly handling PCI IRQ
  352. resoures. All modern (PIII+) motherboards should support the ROM routing table
  353. - but many (PII and earlier) don't, or the table is faulty; PCI therefore is
  354. able to tell us at a glance, wether IRQ management within windows is possible
  355. on that motherboard, and wether the ROM table is in working order or not. I
  356. strongly suggest you don't invest in any motherboard that has a non-existent or
  357. faulty implementation of the ROM IRQ routing table.  Needless to say, a
  358. dockable and/or CardBus equipped laptop without a working routing table is
  359. going to be nothing but trouble.
  360.  
  361. Many older motherbards can gain (or fix bugs in) routing table support with a
  362. FlashBIOS upgrade - visit your motherboard vendor's website (or
  363. http://www.wimsbios.com) for the latest FlashBIOS and see if that helps.
  364. Complain loudly to any vendor with a buggy routing table; with the advent of
  365. Win2000, and the growing popularity of dockable laptops, this sort of thing is
  366. going to be an absolute minimum requirement (along with ACPI support) for a
  367. true overall 'plug and play' operating environment.
  368.  
  369.  
  370.  
  371.   ■ Expansion ROM Information
  372.  
  373. PCI will report on any card that has a ROM *SOCKET* fitted (IE SCSI, Video,
  374. Ethernet cards). PCI will tell you want size ROM is supported in the socket (ie
  375. 64k, 256k, etc). The one thing PCI can't actually tell you is if there really
  376. is a ROM fitted, or not! Many ethernet cards have a ROM socket for a network
  377. bootROM, for example, but the majority of cards don't actually have a bootROM
  378. fitted.
  379.  
  380. The reason why PCI can't detect the ROM is that the programmer is supposed to
  381. enable the ROM to become visible within the PC's address space; then the ROM's
  382. signature and checksum bytes can be inspected to validate it's physical
  383. presence.
  384.  
  385. To enable the ROM you need to decide where in the system's memory map to put
  386. it. This is of course where the problm lies. With modern OS's operating in
  387. protected mode, you can't just 'stick it anywhere' as the OS may be using that
  388. address space already, and with virtualisation of the address space for V86
  389. tasks, any memory accesses we make probably won't wind up going the the right
  390. physical location anyhow. To make this work I would have to interact directly
  391. with the memory manager to request an 'empty' physical memory block, request
  392. the logical-to-physical address mapping data, then map the ROM into the given
  393. region. IMHO this is well beyond my skills, so I gave up!
  394.  
  395. The ROM's aren't always enabled; at BIOS POST-time, they're enabled, copied to
  396. Write-Protected RAM, then disabled again. The RAM-image is made to appear in
  397. the UMB space (IE between 640k and 1Mb), just like a 'normal' ISA option ROM.
  398. It's a bit like ROM BIOS Shadowing, if you like.  The ROM stays disabled
  399. forever more, since the copy in RAM becomes the 'live' copy.  This is done for
  400. speed (BIOS ROM's were shadowed for speed back in the '286 days!), but also it
  401. is also done because the PCI bus usually decodes into memory adress ranges well
  402. above 1Mb.
  403.  
  404.  
  405.  
  406.   ■ Installer mode
  407.  
  408. New to version 0.41ß is installer mode. Installer mode overrides all other
  409. commandline parameters, except /H. Installer mode simply produces a plain dump
  410. of all the 'technical' data about the PCI devices, but doesn't scan
  411. PCIDEVS.TXT, doesn't draw fancy colours, doesn't mess you about in general.
  412.  
  413. The purpose of this mode is for use with automated systems that set up new
  414. computers. In conjunction with some batch files or a second program, you can
  415. take PCI's output and use it to select the right set of drivers to include in
  416. the build of a new system. Because all the vital slot data is included, the
  417. drivers can also be pre-configured to load properly with the right IRQ already
  418. selected, etc.
  419.  
  420.  
  421. Here is a sample of installer mode's output:
  422.  
  423.  
  424. V:1106 D:0598 S:00000000 B:0 E:00 F:0 I:00 N:- C:06 U:00 P:00
  425. V:1106 D:8598 S:00000000 B:0 E:01 F:0 I:00 N:- C:06 U:04 P:00
  426. V:1106 D:0586 S:00001106 B:0 E:07 F:0 I:00 N:- C:06 U:01 P:00
  427. V:1106 D:0571 S:00000000 B:0 E:07 F:1 I:00 N:- C:01 U:01 P:8A
  428. V:1106 D:3038 S:12340925 B:0 E:07 F:2 I:11 N:D C:0C U:03 P:00
  429. V:1106 D:3040 S:00000000 B:0 E:07 F:3 I:00 N:- C:06 U:00 P:00
  430. V:121A D:0003 S:0017139C B:0 E:17 F:0 I:10 N:A C:03 U:00 P:00
  431. V:1011 D:0014 S:01001186 B:0 E:19 F:0 I:09 N:A C:02 U:00 P:00
  432.  
  433.  
  434. Note the absence of the normal header and copyright information. This makes
  435. writing a filter easier as you don't have to find that start of the data.
  436. Leading zeros are inserted to make sure that the entries always start a fixed
  437. number of colums from the left. This means searching the results is MUCH easier
  438. for software.
  439.  
  440. PCIDEVS.TXT isn't processed and isn't required. This means that you can save on
  441. diskspace and also that the program runs much faster from floppy disk; it's
  442. virtualy instant to run no matter how complex your device list.
  443.  
  444.  
  445.     What's reported?
  446.  
  447. V: 4 digit [V]endor ID (Hexadecimal)
  448. D: 4 digit [D]evice ID (Hexadecimal)
  449. S: 8 digit [S]ubSystem ID (Hexadecimal), or 00000000 if no subsystem ID
  450. B: PCI [B]us number
  451. E: PCI d[E]vice ID number
  452. F: PCI device [F]unction Number
  453. I: [I]RQ number, or 00 if none
  454. N: I[N]T assignment, or "-" if none
  455. C: PCI [C]lass code (Hexadecimal)        (Added v0.42ß)
  456. U: PCI s[U]bclass code (Hexadecimal)        (Added v0.42ß)
  457. P: PCI [P]rogramming interface (Hexadecimal)    (Added v0.42ß)
  458.  
  459. ** More fields may be added onto the end of each line, if deemed required in
  460. future. Write your filter to cope!
  461.  
  462. Installer mode may struggle with or ignore CardBus devices - see the cardbus
  463. section for more info; but basically, if your BIOS doesn't have full Cardbus
  464. support, neither will installer mode. Sorry! There's nothing I can do -
  465. complain to your vendor for better BIOS CardBus suport!
  466.  
  467.  
  468.  
  469.   ■ OS/2 Warp
  470.  
  471. Firstly, I don't own or have access to OS/2, so the the following is only
  472. heresay as reported by OS/2 users; but I believe it to be accurate. PCI works
  473. OK under OS/2 - it just runs in a DOS box like any other legacy DOS
  474. application.
  475.  
  476. Apparently an OS/2 specific port of PCI is now available, which is not written
  477. or supported by me! It is my program, heavily modified to be a native OS/2
  478. console application, as well as a few minor behavioural changes to suit the
  479. author's personal taste.  The ported versions carry the letters VK on the end
  480. of the version number - I.E. Version 0.45ßVK.
  481.  
  482. For questions regarding the *vk version, please mail Veit.Kannegieser@gmx.de
  483. His website has an even longer URL than mine; the English version of which
  484. seems to be: http://www-user.tu-cottbus.de/~kannegv/index_e.htm 
  485.  
  486. I encourage OS/2 users to try both versions.  Veit's port usually lags a
  487. version number or two behind mine, and I've had odd reports of his version
  488. crashing where mine doesn't, however there's no reason not to use Veit's
  489. version instead of mine if it works better for you.
  490.  
  491.  
  492. Generally, OS/2's AGP support in OS/2 is minimal, at best. Whilst there is
  493. nothing stopping AGP working in OS/2, very few drivers bother to support it at
  494. all, or only partially (i.e. basic PCI level support, or 1x speed only). You
  495. have to ask yourself if you need AGP under OS/2 anyhow - unless you're somehow
  496. doing 3D gaming, animation or texture mapping, AGP really won't make much of a
  497. difference. Plain old PCI-speed is more than good enough for general 2D work.
  498.  
  499. OS/2 supports PCI interrupt sharing, but many OS/2 drivers (about half) don't.
  500. Thus, it's usually a requirement that there be no shared IRQ's in an OS/2
  501. system. This is getting increasingly awkward to achieve on modern chipsets and
  502. notebooks, further restricting OS/2's continued growth.
  503.  
  504.  
  505.  
  506.   ■ Does my AGP 1x/2x/4x support work, or what?
  507.  
  508. There seems to be some misinformation about support for the faster AGP speeds
  509. out there, not the least of which was caused by an article I wrote some years
  510. back about PCI chipsets on AGP PCB's (cards sold as 'AGP' type, but really just
  511. have 'PCI' level features).
  512.  
  513. Here are the facts. Don't trust anything you read except the following as
  514. there is a lot of misinformation or just plain outdated commentry out there on
  515. the web...
  516.  
  517. All AGP cards made since 1998 are the true AGP type; that is they support
  518. enhanced speeds beyond that of PCI (I know of no exceptions to that rule!).
  519. Only a small number of very early AGP cards are really just PCI chipsets on AGP
  520. cards, but be aware they do exist (mostly in older systems circa 1995-7).
  521.  
  522. To identify a "true" AGP card, check for the New Capabilties List of the device
  523. for an "AGP Capabilty" entry.  AGP capability version 1.0 supports AGP 1x and
  524. optionally 2x, whilst version 2.0 adds 4x support and version 3.0 adds 8x
  525. support. All AGP cards MUST have this 'New Capability' data present to operate
  526. in AGP mode.
  527.  
  528. Next, check your chipset's AGP bridge's New Capabilities List to determine the
  529. chipset's AGP support level. If you don't have an AGP Bridge somewhere in your
  530. system, you probably don't have an AGP video card :-)
  531.  
  532. Compare the two AGP Capability Lists and identify the highest common supported
  533. speed. For example, the Nvidia GeForce2 MX has a maximum AGP speed of 4x, but
  534. the VIA MVP3 AGP bridge has a maximum speed of 2x, so 2x is the fastest
  535. possible speed available on that system. In this case, the GeForce2 MX will
  536. perform more slowly than if it were in a more modern system and able to run at
  537. it's full 4x speed.
  538.  
  539. Next, see if AGP mode is actually enabled (It's written as a NO in red if it
  540. isn't and as a YES in green if it is), and read off the selected speed.
  541.  
  542. Note: If you run PCI *WITHOUT* your motherboard's AGP drivers, *AND* the
  543. display card's drivers correctly loaded and functioning, AGP WILL REPORT AS
  544. DISABLED!!!! That means running PCI from plain DOS will ALWAYS report AGP as
  545. disabled, no matter what! Always make sure both the chipset and video drivers
  546. specific to your chipset and display adapter are correctly installed and
  547. functioning, or AGP support will not work!
  548.  
  549. To get AGP mode enabled, the host CHIPSET must be initialised into AGP mode (IE
  550. the GART must be configured and enabled) and then the display adapter must be
  551. put into AGP mode and accessed that way. AGP mode is not compatible with legacy
  552. type VGA adapters, and thus it won't work when your OS is trying to access the
  553. VGA card the 'traditional' way.
  554.  
  555. SO.. the only way to properly check on AGP support is to run PCI in a DOS
  556. window under your operating system... this means Win2k/NT/XP machines can't be
  557. checked currently. Sorry! (I'm working on it!!)
  558.  
  559.  
  560.  
  561.  ■ Bugs, stuff yet to come, limitations, etc.
  562.  
  563. PCI is known to not operate under Windows NT, 2000 or XP. If you run
  564. NT/2000/XP, you must boot with DOS or Win95/98/ME to run PCI. This is because
  565. NT's HAL denies PCI access to the system BIOS and I/O ports necssary for PCI to
  566. operate. I'm working on a version that will work on newer OS's, but it's a hard
  567. task for me - please be patient while I learn about win32 coding, device
  568. drivers and the like.
  569.  
  570. Basically, full decoding of all the PCI data is yet to be implemented... mainly
  571. because I don't own full copies of all the 'official' PCI specification
  572. documents, (And I am unable to get them as they cost $$$ and I don't live in
  573. the USA so I have no easy way to transmit payment...presuming I wanted to pay
  574. for them at all). So, I am reliant on snippets of information collated from
  575. books, data sheets, YOUR INPUT, etc etc. See the web page for more info, and
  576. the text of the next section.
  577.  
  578. I now have a copy of most of the specs circa PCI 2.2 level (Thanks to a
  579. generous [you know who you are] who posted them at his expense all the way from
  580. Canada to Australia for me!), but PCI 3.0 is just about to come out so again I
  581. will be "behind" shortly.
  582.  
  583. Having said all that, PCI is now a very mature product (developed now for ~7
  584. years) and it is 'virtually' complete. There isn't much left to do, and each
  585. new version is improving support, for example CardBus support is now finally
  586. working, and AGP 8x support has recently been added.
  587.  
  588.  
  589.  
  590.  
  591.  ■ And to the PCI SIG:
  592.  
  593. Official PCI Programming information is not freely available. The controlling
  594. body the "PCI Special Interest Group" has determined that documentation will be
  595. made available only to those willing to pay for it. And it's not cheap, or
  596. easily obtainable outside the USA. I have the following to say to the PCI SIG:
  597.  
  598. Charging money for your documentation not only restricts programmers and end
  599. users from adopting the PCI standard, but makes a mockery of the concept of
  600. open information sharing that the Internet has always stood for. Rather than
  601. take such a petty attitude towards Joe Average programmer, why not release your
  602. documentation freely in electronic format? It can only help establish your
  603. standards further.
  604.  
  605. Freely releasing formal documentation would also mean that programmers such as
  606. myself can stop guessing about PCI, and stop writing up alternative
  607. documentation that may, ultimately, be incorrect. I'm sure that the current
  608. host of "third party" documentation (along with it's errors) can only make PCI
  609. look BAD, not good.
  610.  
  611. Remember MCA? In 1987 we already had what PCI now offers.. please don't kill
  612. PCI the same way IBM killed MCA.
  613.  
  614. The new website now has many (but not all) PCI Specifications documents online
  615. for absolutely FREE DOWNLOAD. Up yours, PCI-SIG!
  616.  
  617.  
  618.  
  619.  ■ Compiling PCI
  620.  
  621. To re-compile PCI, you'll need a copy of Borland Turbo Pascal 7.0 for DOS. I
  622. have no idea if other versions work or not; 6.0 probably will. Put all the
  623. files from the zip into the one directory. Run TURBO to get into the TP GUI.
  624. Load pci.pas and press F9 to compile. Done!
  625.  
  626.  
  627.  
  628.  ■ How to "parse" PCIDEVS.TXT
  629.  
  630. Writing your own code to use my database? GREAT! You're more than welcome: the
  631. database is freeware and you may use it for any purpose, including commercial
  632. purposes. Here's how *I* parse the list, in "pseudocode". I hope this makes it
  633. easier for you to write a parser too. Please forgive me if you think this is
  634. poorly designed/could be done better; the technique stems from three things:
  635.  
  636. - Sourcefile is TEXT, not Binary, so there are no fixed field lengths.
  637. - Many fields are optional so the catch-22 of "you dunno if it's there 'till
  638.   you read it, but once you've read it, you can't go back a line if it wasn't
  639.   what you expected" applies.
  640. - The program has been added to and expanded "ad hoc" over a 5 year period.
  641.   Inevitable oversights and extensions have been dealt with several times.
  642. - The basic file format can't be changed since there are many programs
  643.   (including a couple of commercial packages) relying on my file format not
  644.   changing.
  645.  
  646.  
  647.  
  648.  
  649.  
  650. Open the file as text (not binary) and read top to bottom, one line at a time.
  651.  
  652. 1. Look for V entries, until you make a match to the vendor ID, or EOF in which
  653. case report unknown vendor & device. Display Vendor Name.
  654.  
  655. <the file position pointer now points to the list of devices for that Vendor>
  656.  
  657.  
  658. 2. Read D entries until you get a match to the device ID, or hit another V
  659. entry or EOF in which case stop and report unknown device. DONT display Device
  660. Name yet!!
  661.  
  662. <the file position pointer now points to possible device revision records>
  663.  
  664.  
  665. 3. Read R entries until you get a match with the device's revision ID, or you
  666. run out of R entries, or EOF. (There may be no R entries at all). If you match
  667. R, then display that entry for the Device Name, otherwise display the Device
  668. Name from the D entry... R is more accurate than D, but you might not match R.
  669.  
  670. <the file position pointer now points to possible subsystem records>
  671.  
  672.  
  673. 4. If you matched D(and/or R), and the subsystem ID is <>00000000 then (look
  674. for subsystem match):
  675.  
  676.    in a loop, read a line, and
  677.      - try to match an X code with the 8 digit subsystem ID.
  678.      - try to match an O code with your subsystem vendor ID. Remember the
  679.        "generic" part description. Note the match, Keep going in this loop.
  680.      - try to match an S code with your subsystem device ID, but only if the O
  681.        code has already been matched.
  682.    exit when you matched an X code, or (matched an S AND an O code), EOF, or
  683.    you hit another V or D code.
  684.  
  685. - if you EOF or matched neither X, O nor S, report unknown subsystem ID.
  686. - if you matched an X entry, report info next to X entry, and warn user this
  687. is a known "oddball" device that has an otherwise invalid subsystem ID. (Ignore
  688. any partial S-but-not-O match, if any - its a false alarm).
  689. - if you matched O BUT NOT S, report the "generic" ID you remembered. Warn
  690. user it may not be "fully" accurate, but is just a guestimation.
  691. - if you matched O AND S, report info next to S entry; you exactly matched the
  692. subsystem ID.
  693.  
  694. 5. close list
  695.  
  696. 6. If you have an O code, re-open the list. Scan list reading the V entries,
  697. but try to match with the O code. This tells you the OEM name. Stop at match or
  698. EOF. If EOF, report unknown OEM ID. Close list.
  699.  
  700. List must be closed and re-opened because the O name may be "higher" up the
  701. list, thus a scan-to-the-end of the list will not match. This also means this
  702. check must be done last since it causes us to "loose our spot" in the list.
  703. Filepos() doesn't work (in Pascal, at least) since we're working with a
  704. textfile!! (Argh!!)
  705.  
  706. If you find an invalid code letter, IGNORE IT; just move onto the next line.
  707. This lets us add new code letters and not 'break' existing code.
  708.  
  709.  
  710.  
  711.  
  712.  ■ Other formatting notes for PCIDEVS.TXT:
  713.  
  714. All useful lines are formatted thus:
  715.  
  716. <Code Letter><Tab><2-8 hex digits><tab><text>
  717.  
  718. You may NOT replace <tab> with <space>! Also, do NOT replace a tab with eight
  719. spaces!!! the parser counts characters left to right, and looks for the tab
  720. character, so wrong, extra or missing characters will result in a wrongly
  721. parsed line. This means the file formatting must be kept strictly in check at
  722. all times. Use my CHKPCI utility (Available seperately from the website) to
  723. inspect and validate your changes.
  724.  
  725. Overall, total line length must be 255 characters or less (Pascal language
  726. limitation). Try to keep the text under about 70 chars for display legibilty
  727. (excessive display wordwrap really is in poor taste :-/)
  728.  
  729. All entries must always follow numerical order, lowest to highest. This makes
  730. duplicates almost impossible when editing, but the parser doesn't actually
  731. care, since it works on "keep looking until you run out" principle. A "tiny"
  732. efficiency could be added by coding in "if database ID > our ID, give up" but I
  733. hardly see the point, since the program runs faster than you can blink anyhow.
  734.  
  735. You should ignore all lines not starting with a valid code letter,tab sequence.
  736. This allows clarity by inserting blank lines and comments wherever it may
  737. please you. For clarity, begin comment lines with a <;> character; Accidental
  738. capitilisation of the first word of a comment could lead to a wrongly parsed
  739. code.
  740.  
  741. Valid Codes:
  742.  
  743.   V    Vendor ID. 4 digit hex number.
  744.   D    Device ID. 4 digit hex number.
  745.   R    Revision ID. 2 digit hex number.
  746.   X    Incorrectly formatted susbsystem ID. 8 digit hex number.
  747.   O    Subsystem OEM ID. 4 digit hex number. (top 16 bits of subsystem ID)
  748.   S    Subsystem device ID. 4 digit hex number. (low 16 bits of subsystem ID)
  749.  
  750. The codes must always appear in this order in the file. Multiple O and S
  751. entries may appear. O entries may appear without S entries. Only V and D
  752. entries are required to identify a device - all others are optional and my be
  753. omitted.
  754.  
  755. A note on R entries: R is NOT permitted under a subsystem entry. A chipset
  756. revision is just that - the BASE CHIPSET's revision. The OEM can't have any
  757. influence on the chipset's revision, since he doesn't make it! Thus, R is of no
  758. use under the subsystem. I very much doubt any OEM has made two different model
  759. cards by carefully buying different revision chips from the chipset vendor!!
  760.  
  761. A note on X entries: X entries are very rare. In the "early days" of subsystem
  762. ID's, some vendors apparently thought they had carte blanche to put in any
  763. number they liked. WRONG! However a few devices now exist with nonsensical
  764. subsystem ID's like "55555555" or "F0F01234" and suchlike. X entries take care
  765. of these few "oddball" devices. I don't expect to add any more than one or two
  766. new X entries, ever.
  767.  
  768. ** New code letters may be added from time to time, so your code should always
  769. ignore any unknown code letters. This lets up expand the scope of the file
  770. without 'breaking' existing code.
  771.  
  772.  
  773.  
  774.  ■ Program Revision Information
  775.  
  776.   version 0.00ß : Initial private release: Didn't crash my home PC!
  777.  
  778.   version 0.10ß : fixed bug whereby if either vendor byte is $FF, we would
  779.                   skip the device. Ouch! Now finds devices reported as xxFF on
  780.                   some buggy Award BIOS's chipsets. (Notibly, 80FF, not 8086
  781.           for the 82430FX IDE Ctrlr).
  782.           fixed problem decoding infotable[6].
  783.           fixed select timing decoding fixed irq=$ff decoding
  784.  
  785.   version 0.11ß : fixed bug displaying select timing modes
  786.  
  787.   version 0.12ß : added "subsystem id" information display
  788.           made cache line size display only if it exists (ie is<>0)
  789.           added /H parameter to use cfg mechanism 1, not BIOS to
  790.           read the hardware directly (gets around 80FF bug)
  791.           added bus mastering capability & latency reporting
  792.           added prefetchability reporting to memory ranges
  793.           fixed up several minor display and reporting issues
  794.           made IRQ display only if it's valid
  795.  
  796.   version 0.13ß : fixed some display formatting bugs
  797.           subsystem ID's only displayed if valid (<>00000000)
  798.           Added subsystem recognition system (after many requests)
  799.           Added ability to direct output to a file ie "C:\>pci > log"
  800.  
  801.   version 0.14ß : Added commandline parameter /D to dump device configuration
  802.           space, if required. This is usefull when programming a
  803.           PCI device, and/or looking for 'hidden' registers, features,
  804.           etc etc.
  805.  
  806.   version 0.15ß : added subsystem vendor display; it's not always accurate,
  807.           (Some vendors are ignoring the rules) but when it is right,
  808.           it can be very useful.
  809.           Added capabilities list decoding & display - not yet tested!
  810.           Tidied up the code here and there - fixing my cruddy coding
  811.           fixed major bugs with Expansion ROM info display
  812.           fixed minor potential bug with I/O port decoding
  813.           added interface type to class code line
  814.  
  815.   version 0.16ß : Fixed a stupid bug with new capabilities list display
  816.           Added raw-dump of Power Management capability data
  817.  
  818.   version 0.17ß : fixed some minor display formatting problems
  819.           fixed several problems decoding type 2 headers
  820.           fixed another bug with expansion ROM decoding
  821.           added some more decoding of type 1 headers
  822.           added some more decoding of type 2 headers
  823.           added info on PCI IDE controllers & mode(s) of operation
  824.           added error checking for case of VENDORS.TXT missing
  825.           added some decoding of "power management" new capability
  826.  
  827.   version 0.18ß : fixed display formatting bug with PCI IDE info
  828.  
  829.   version 0.19ß : added IRQ summary to end of display
  830.           added generic subsystem ID detection & note
  831.           fixed compiler leaving debug-info in EXE
  832.           cleaned up a few minor display issues
  833.  
  834.   version 0.20ß : added several new class codes intoduced with PCI spec v2.2
  835.           added decoding of command register
  836.           fixed "status 0200h ()" display formatting bug & redrew
  837.             the general layout of the Status info to avoid commom
  838.             wordwrap problem and to more correctly display timing +
  839.             busmaster info next to their "source" register
  840.           fixed "Number of PCI busses : 0"
  841.  
  842.   version 0.21ß : added MSI Capability detection
  843.           added shared IRQ summary
  844.           indented capabilities listings to make them more readable
  845.           fixed error in classes.pas missing out the last few entries
  846.           added ExpROM decode for type 1 headers
  847.           added I/O port range decode for PCI Bridges
  848.           fixed display wordwrap problems
  849.           full decoding of Self Test function byte
  850.  
  851.   version 0.30ß : converted to PCIDEVS.TXT format, added subsystem prediction
  852.           code
  853.  
  854.   version 0.31ß : fixed slight bug with unknown subsystem vendor ID
  855.           added /S parameter for brief summary only report
  856.           changed IRQ reporting to reject bad IRQ values (0<IRQ<16)
  857.           this fixes runtime error 201 on compaq triflex bridge!
  858.  
  859.   version 0.32ß : added revision ID decoding for more accurate chipset-id
  860.             added a load of info in the documentation on PCIDEVS.TXT
  861.           structure, parsing, etc
  862.           fixed problem with IRQ list wrong in summary mode because IDE
  863.             IRQs not recorded
  864.           Updated help to current feature set
  865.  
  866.   version 0.33ß : added PCI IRQ Routing table Win9x compatibility tests
  867.  
  868.   version 0.34ß : fixed some bugs in new routing table check routine
  869.  
  870.   version 0.35ß : fixed capability pointer bug with type 1 headers
  871.           IRQ summary display formatting fixed
  872.           PCI major revision number leading 0 dropped
  873.           help page again fits into one 25 line screen
  874.           added display bus/device/function info option
  875.  
  876.   version 0.40ß : added 'None' to "IRQ's dedicated to PCI" for when there are
  877.             truely none reported in the IRQ routing table info
  878.           added first attempt at PCI slot INTx routing data display
  879.           fixed a bug in "IRQ's dedicated to PCI" omitting IRQ 15
  880.           added latest PCI 2.2 class codes; fixed bugs in classes code
  881.           better error checking on AGP capability list
  882.  
  883.   version 0.41ß    : added all missing capability ID's per PCI rev 2.2 specs
  884.           fixed incorrect device name on slot irq-router info
  885.           added pause for keypress function when writing to screen
  886.           fixed new capabilities list bug for first capability = last
  887.             capability signature (i.e. no capabilities listed)!
  888.           fixed up ROM info - was totally wrong previously!
  889.           added /I installer mode report for system builders
  890.           /? now works even if PCIDEVS.TXT missing
  891.           help on error messages now more comprehensive
  892.  
  893.   version 0.42ß : fix up class code FFh reporting
  894.           added class, subclass & prog IF info to installer mode
  895.  
  896.   version 0.43ß : fix up errors in power management capability info
  897.           fix a spelling error -> "decryption"
  898.           don't read past config register $3f in installer and
  899.             summary modes to avoid crashing on intolerant hardware
  900.           fix some truncated text strings in class codes
  901.           added sanity checks for conflicting command line switches
  902.           added a lot to 'new capability' decoding section
  903.           fixed all the bugs with scanning cardbus devices
  904.  
  905.   version 0.44ß : fixed pci-x max speed 66, not 64
  906.           fixed shared IRQ count wrong if IDE controller IRQ field
  907.             reported by device
  908.           fixed duplicate scan of CardBus issue with some PCI BIOS's
  909.           added new capability code 09h recognition
  910.           fixed another CardBus bug with unconfigured controllers
  911.  
  912.   version 0.45ß : fixed overflow bug due to compiling with overflow checking
  913.             on. this has also reduced size of executable slightly
  914.           fixed potential bug with checksumming corrupt routing tables
  915.           extensively revised and expanded documentation with a load
  916.             of general comments and background info, tips etc.
  917.           fixed bug with parsing comment lines in middle of subsystem
  918.            entries in pcidevs.txt
  919.  
  920.   version 0.46ß : added support for AGP v3.0 as per rev 0.95 of AGP v3.0 specs
  921.             (This adds support for AGP 8x recognition)
  922.           further revisions, expansion and updates to documentation
  923.  
  924.   version 0.47ß : added revision field to Installer mode
  925.           added class code for EHCI USB controller
  926.           fixed some minor display indent-formatting issues
  927.           added more decoding of type 1 headers (PCI bridges)
  928.           added more decoding of PCI-X capability info
  929.           fixed a couple of minor code errors and a class code database
  930.             error
  931.           added support for PCI v2.3 standard
  932.           fixed more bugs in pci power management capability info
  933.  
  934.   version 0.48ß : fix more stuff, mostly cosmetic errors
  935.  
  936.   version 0.49ß : fixed more power management decode errors
  937.           updated to PCI v3.0 spes throughout, incl. class codes
  938.           updated with initial PCI Express support
  939.                   fixed all the shared bugs discovered via pci32 0.52ß release
  940.  
  941. <EOF>
  942.